package business.command
{
	import business.modelLocators.ProductModelLocator;
	
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import business.event.AddProductToShoppingCartEvent;
	import mx.rpc.IResponder;
	
	import valueObjects.Product;
	
	public class AddProductToShoppingCartCommand implements ICommand, IResponder
	{
		[Bindable]
		private var productModel:ProductModelLocator = ProductModelLocator.getInstance();
			
		public function AddProductToShoppingCartCommand()
		{
		}
		public function execute(event:CairngormEvent):void {
			var product:Product = (event as AddProductToShoppingCartEvent).product;
			productModel.currentShoppingCart.addProduct(product);
		}
		public function result(result:Object):void {
			
		}
		public function fault(info:Object):void {
			
		}

	}
}